package com.dahuyou.netty.outboundHandlerAndInboundHandler.client;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelOutboundHandlerAdapter;
import io.netty.channel.ChannelPromise;

public class MyTuoMinOutMsgHandler extends ChannelOutboundHandlerAdapter {

    /*@Override
    public void read(ChannelHandlerContext ctx) throws Exception {
        ctx.writeAndFlush("ChannelOutboundHandlerAdapter.read 发来一条消息\r\n");
        super.read(ctx);
    }*/

    @Override // 调用ctx的writeAndFlush方法时会被该方法拦截执行
    public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
        System.out.println("MyOutMsgHandler.write 111111111--脱敏处理");
        msg += "--tuomin";
        super.write(ctx, msg, promise);
    }

}
